<template>
	<div id="home">
		<home-header></home-header>
		<home-swiper :swiperList="swiperList"></home-swiper>
		<home-icon :iconList="iconList"></home-icon>
		<home-recommend :recommendList="recommendList"></home-recommend>
		<weekend :weekendList="weekendList"></weekend>	
	</div>	
</template>

<script>
import HomeHeader from "./components/HomeHeader"
import HomeSwiper from "./components/Swiper"
import HomeIcon from "./components/Indexicon"
import HomeRecommend from "./components/HomeRecommend"
import Weekend from './components/Weekend'
import axios from 'axios'
export default{
	name: "Home",
	components: {
		HomeHeader,
		HomeSwiper,
		HomeIcon,
		HomeRecommend,
		Weekend
	},
	data () {
		return {
			iconList: [],
			swiperList: [],
			recommendList: [],
			weekendList: []
		}
	},
	methods: {
		getHomeInfo () {
			axios.get('/api/index.json')
			.then(this.getHomeInfoSucc)
		},
		getHomeInfoSucc (res) {
			res = res.data
			if (res.ret && res.data) {
				const data = res.data
				this.iconList = data.iconList
				this.swiperList = data.swiperList
				this.recommendList = data.recommendList
				this.weekendList = data.weekendList
			}
		}
	},
	mounted () {
		this.getHomeInfo()
	}

}
</script>

<style lang="stylus" scoped>
	
</style>

